from django.db import models
from .productModel import *
from .userModel import *


class Cart(models.Model):
    buyNum = models.IntegerField()
    imgUrl = models.CharField(max_length=200)
    masterName = models.CharField(max_length=50)
    price = models.DecimalField(max_digits=8, decimal_places=2)
    product = models.ForeignKey(to=Product, on_delete=models.SET_NULL,null=True)
    slaveName = models.CharField(max_length=50)
    user = models.ForeignKey(to=User,on_delete=models.SET_NULL,null=True)

    class Meta:
        db_table = 'zz_Cart'
